<?php
namespace app\model;

class Package extends Common
{
    protected static $obj;

    public function _initialize()
    {
        parent::_initialize();
        $this->db_name = 'package';
    }

    /**
     * 类入口
     * @return Package
     */
    public static function getInstance()
    {
        if (is_null(self::$obj))
            self::$obj = new self();
        return self::$obj;
    }

    /**
     * 验证id
     * @param $int_question_id int 用户地址id
     * @return bool
     */
    public function checkPackageId($int_package_id)
    {
        $package_info = $this->toFind(['id' => $int_package_id], 'id,name');
        if (isset($package_info['id']) && $package_info['id'] > 0) return $package_info['name'];
        return false;
    }
}
